programming4us
           
 
 
Windows Server

Windows Server 2012 : Monitoring, Tuning, and Troubleshooting Hyper-V - Using VM Monitoring

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/14/2013 7:29:17 PM

System monitoring is the process of determining and finding problems in any of your servers, either physical or virtual.

VM Monitoring is a great assistant for virtual machine monitoring in clustered environments and helps to detect whether a virtual machine is running in a critical state. It will allow you to check the health of the VM service at the host level, identifying issues using events and status messages. VM Monitoring also enables the host to start a task to solve the problem in a proactive way, with no user interaction. In other words, it will check whether something is wrong, and if necessary, it will try to fix the problem automatically.

This recipe will show you how to prepare the virtual machine and the Management OS to use VM Monitoring.

Getting ready

There are some prerequisites that you need to note before you start. The first thing is that VM Monitoring is only available on virtual machines running on a cluster. All the host computer configurations are done through the Failover Cluster Manager console.

The virtual machine must be part of the same domain as the Management OS, and the user used to administer Failover Clustering must be a member of the local administrators group in the VM.

Last but not least, VM Monitoring is only available on virtual machines that run Windows Server 2012.

How to do it...

The following steps will demonstrate how to prepare the virtual machine to be monitored by VM Monitoring, how to enable it from the host so as to monitor a service, how to monitor Event Viewer entries within the VM, and how to check the VM Monitoring results:

  1. To configure the VM to be monitored using VM Monitoring, open the Failover Cluster Manager console from one of the cluster nodes (or a machine that has Failover Cluster Manager installed) by typing cluadmin.msc on the Start menu.
  2. In the Failover Cluster Manager window, expand your cluster, click on Roles, select the virtual machine that you want to prepare for use with VM Monitoring, and click on Connect in the right-hand pane.
  3. Make sure the VM is started, and log in using a local administrator account.
  4. To create a Windows Firewall exception, launch the Start menu and type firewall. In the right-hand pane, click on Settings and select Windows Firewall.
  5. On the left-hand pane, click on Allow an app or feature through Windows Firewall.
  6. In the Windows Firewall window, click on Change settings.
  7. Under Allowed apps and features, select Virtual Machine Monitoring and select the networks you are connected with, as shown in the following screenshot:
    How to do it...

    Note

    You can also configure the VM Monitoring firewall exception using the following command:

    Set-NetFirewallRule -DisplayGroup "Virtual Machine Monitoring" -Enabled True
    
  8. To configure the recovery service action on the service that will be monitored, launch the Start menu and type services.msc to open the Services console.
  9. In the Services console, in the service list, double-click on the service you want to monitor and click on the Recovery tab.
  10. Select the actions for First failure, Second failure, and Subsequent failures, as shown in the following screenshot.
  11. When finished, close all windows and virtual machine connections.
    How to do it...
  12. To configure VM Monitoring to monitor a service, from the Management OS, open the Failover Cluster Manager console again, right-click on the virtual machine you configured to enable VM Monitoring, select More Actions, and click on Configure Monitoring.
  13. In the Select Services window, select the service you want to monitor and click on OK, as shown in the following screenshot:
    How to do it...
  14. If you want to add a service that is not in the service list, type the following command from one of the failover cluster nodes, changing SYD-SP1 to the virtual machine name and MyApplication to the service name you want to add:
    Add-ClusterVMMonitoredItem –VirtualMachine SYD-SP1 –Service MyApplication
    
  15. To configure VM Monitoring to monitor an event from Event Viewer, open the virtual machine connection again.
  16. From the VM, open Server Manager.
  17. In the Server Manager window, click on Manage in the right-hand pane and click on Add Roles and Features.
  18. In the Add Roles and Features Wizard window, click on Next four times.
  19. In the Select features section, expand Remote Server Administration Tools | Feature Administration Tools | Failover Clustering Tools, and select Failover Cluster Modules for Windows PowerShell, as shown in the following screenshot. Click on Next and then Finish to start the installation.
    How to do it...
  20. On the VM, open PowerShell and type the following command by replacing Application with the event log you want to monitor, MyApplication with the event source you will use, and 123 with the event ID VM Monitoring will monitor:
    Add-ClusterVMMonitoredItem –EventLog "Application" –EventSource "MyApplication" –EventID 123
    
  21. To change the default action triggered on the host computer when one of these monitoring resources is alerted, open Failover Cluster Manager, select the virtual machine in Roles, and click on the Resources tab at the bottom.
  22. In the Resources tab, right-click on the virtual machine and click on Properties.
  23. In the properties window for the virtual machine, select the Policies tab and configure the response to resource failure options. The default configuration, which is shown in the following screenshot, will attempt to restart the virtual machine if one of the configured VM Monitoring is triggered. If the restart is unsuccessful, the VM will fail over to another node in the cluster.
    How to do it...
  24. To check the virtual machine monitoring status, select the virtual machine in Failover Cluster Manager and check the Status details.
  25. If the virtual machine has triggered one of the monitored options, a status showing Running (Application in VM Critical) will be displayed, as shown in the following screenshot:
    How to do it...
  26. To check the status on all virtual machines using PowerShell, type the following command from one of the nodes that is a member of the cluster:
    Get-ClusterResource | fl StatusInformation
    
  27. To check the virtual machine status using Event Viewer, open Event Viewer in one of the failover cluster nodes.
  28. In the Event Viewer window, expand Windows Logs and click on System. Click on Event ID to list events by ID, and double-click on the event with the ID 1250; you will see the following screen:
    How to do it...

How it works...

VM Monitoring can be enabled on every virtual machine with Windows Server 2012 running in a cluster, to monitor services and events from the host computer without the need to connect to the VM to check its status.

VM Monitoring requires that the virtual machine be in the same domain as the host computer. It also needs the failover cluster administrator that is used to set VM Monitoring to be a member of the local administrator group within the VM.

After these prerequisites, a firewall exception to allow VM Monitoring must be created to allow the Management OS to connect to the VM.

When monitoring a service, you can specify what will happen within the VM in case of service failure, by using the Recovery tab from the Services console. It allows three actions in a different order to be configured and can be used to automatically carry out an action, such as sending an e-mail or running a script to solve the problem.

Using Failover Cluster Manager, you can enable VM Monitoring by selecting which services you want to monitor. In case the service is not listed, the command Add-ClusterVMMonitoredItem can be used from the host computer, to add it to the list.

Although it is not available using the graphical interface, Event Viewer logs can also be monitored on your VMs, using PowerShell. The necessary commands used to enable Event Viewer monitoring are part of the Failover Clustering module and need to be installed within the VM.

From the node members of the cluster where the VMs sit, you can use the status information from Failover Cluster Manager or use Event Viewer, searching for the event ID 1250 on the system log, to check whether one of the monitored items was triggered.

When a problem is found by the cluster, the VM is restarted by default, and in case of failures, a failover process occurs. These failure actions can be changed through the virtual machine properties. Rather than carrying out an action, you can create an Event Viewer task to send an alert to the IT team with the status information, for example.

Although VM Monitoring is very handy, it is not enough. It is important to think about other monitoring tools that can give more details and alerts from your whole infrastructure, with reports and advanced features. A good example is System Center Operations Manager, a server where you can centralize all monitoring data, which can include servers, applications, network devices, desktops, and many other components from different brands and providers.

Other -----------------
- Windows Server 2012 : Monitoring, Tuning, and Troubleshooting Hyper-V - Using Perfmon for logged monitoring
- Windows Server 2012 : Monitoring, Tuning, and Troubleshooting Hyper-V - Using real-time monitoring tools
- Windows Server 2008 : Licensing and Activation - Forcing Registration of KMS Server SRV Records, Manually Creating an SRV Record for KMS
- Windows Server 2008 : Licensing and Activation - Managing Activation Tasks with slmgr
- Windows Server 2008 : Migrating Printers with printbrm, Controlling the Print Queue with prnqctl.vbs
- Windows Server 2008 : Publishing Printers to Active Directory with pubprn.vbs
- Windows Small Business Server 2011 : Deploying Network Printers (part 4) - Sharing a Printer
- Windows Small Business Server 2011 : Deploying Network Printers (part 3) - Creating a DHCP Reservation for a Printer
- Windows Small Business Server 2011 : Deploying Network Printers (part 2) - Installing a Network-Attached Printer, Installing a Network Printer Manually
- Windows Small Business Server 2011 : Deploying Network Printers (part 1) - Creating a Printer - Installing a Local Printer Manually
- Windows Small Business Server 2011 : Sharing Printers- Understanding Windows Printing
- Windows Home Server 2011 : Getting More Out of Control Panel (part 2) - Alternative Methods for Opening Control Panel Icons
- Windows Home Server 2011 : Getting More Out of Control Panel (part 1) - Understanding Control Panel Files
- Windows Home Server 2011 : Using the Local Group Policy Editor (part 3) - Increasing the Size of the Recent Documents List, Enabling the Shutdown Event Tracker
- Windows Home Server 2011 : Using the Local Group Policy Editor (part 2) - Customizing the Places Bar
- Windows Home Server 2011 : Using the Local Group Policy Editor (part 1) - Working with Group Policies, Customizing the Windows Security Screen
- Windows Server 2012 : Backup and Recovery (part 8) - Backing up and restoring Active Directory
- Windows Server 2012 : Backup and Recovery (part 7) - Backing up and recovering your data - Recovering data stored on another server, Recovering the system state
- Windows Server 2012 : Backup and Recovery (part 6) - Backing up and recovering your data - Tracking scheduled and manual backups, Recovering your data
- Windows Server 2012 : Backup and Recovery (part 5) - Backing up and recovering your data - Performing a one-time backup
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us